﻿///////////////////////////////////////////////////////////////////////////////
//
//  xmlextra.js   			version 1.0
//
//  This file is provided by Microsoft as a helper file for websites that
//  incorporate Silverlight Objects. This file is provided under the Silverlight 
//  SDK 1.0 license available at http://go.microsoft.com/fwlink/?linkid=94240.  
//  You may not use or distribute this file or the code in this file except as 
//  expressly permitted under that license.
// 
//  Copyright (c) 2007 Microsoft Corporation. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////
function sendNodes(searchName, myXML)
{	
    for(var i = 0; i < myXML.childNodes.length; i++)
    {	
        var currentNode = myXML.childNodes[i];

		if(currentNode.nodeName == searchName)
		{
            return currentNode;
		}
        if(currentNode.childNodes.length > 0)
		{
             var returnNode = this.sendNodes(searchName, currentNode);
			 if(returnNode != undefined )
			 {
				return returnNode;
			 }
    	}
	}
}

function nodeNumber(myXML)
{	
	if (document.getElementById && !document.all)
	{   
        //Mozilla
		return ((myXML.childNodes[0].childNodes.length)-1)/2;
	}
	else
	{
	    //IE
		return myXML.childNodes[1].childNodes.length;
	}
}


function innerNodeNumber(myXML)
{
    if (document.getElementById && !document.all)
	{   
        //Mozilla
	    return ((myXML.childNodes.length)-1)/2;
	}
	else
	{
	    //IE
	    return ((myXML.childNodes.length));
    }	
}